home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 46
/
Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso
/
-serious-
/
comms
/
www
/
urlx
/
stricmp_test.c
< prev
next >
Wrap
C/C++ Source or Header
|
1999-09-06
|
1KB
|
87 lines
#include <string.h>
main()
{
int duff = 0, result = 0;
if (stricmp("A","a") == 0)
printf("A == a\n");
else
{
printf("A != a\n");
duff = 10;
}
if (stricmp("a","A") == 0)
printf("a == A\n");
else
{
printf("a != A\n");
duff = 10;
}
if (stricmp("A","B") > 0)
printf("A > B\n");
else if (stricmp("A","B") < 0)
printf("A < B\n");
else
{
printf("A == B !!!\n");
duff = 10;
}
if (stricmp("a","B") == 0)
printf("a == B\n");
else if (stricmp("a","B") < 0)
printf("a < B\n");
else
{
printf("a == B !!!\n");
duff = 10;
}
if (stricmp("A","_") > 0)
{
printf("A > _\n");
result = 1;
}
else if (stricmp("A","_") < 0)
{
printf("A < _\n");
result = -1;
}
else
{
printf("A == _\n");
result = 0;
duff = 10;
}
if (stricmp("a","_") > 0)
{
printf("a > _\n");
if (result < 0)
duff = 10;
}
else if (stricmp("a","_") < 0)
{
printf("a < _\n");
if (result > 0)
duff = 10;
}
else
{
printf("a == _ !!!\n");
duff = 10;
}
if (duff)
printf("stricmp unusable\n");
else if (result > 0)
printf("all characters considered to be lower case\n");
else if (result < 0)
printf("all characters considered to be upper case\n");
exit(0);
}